/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package persistentClass;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Duc
 */
@Entity
@Table(name = "mem")
@NamedQueries({@NamedQuery(name = "Mem.findAll", query = "SELECT m FROM Mem m"), @NamedQuery(name = "Mem.findByMemberCode", query = "SELECT m FROM Mem m WHERE m.memberCode = :memberCode"), @NamedQuery(name = "Mem.findByName", query = "SELECT m FROM Mem m WHERE m.name = :name"), @NamedQuery(name = "Mem.findByPhoneNumber", query = "SELECT m FROM Mem m WHERE m.phoneNumber = :phoneNumber"), @NamedQuery(name = "Mem.findByEmail", query = "SELECT m FROM Mem m WHERE m.email = :email"), @NamedQuery(name = "Mem.findByAddress", query = "SELECT m FROM Mem m WHERE m.address = :address"), @NamedQuery(name = "Mem.findByBirthYear", query = "SELECT m FROM Mem m WHERE m.birthYear = :birthYear"), @NamedQuery(name = "Mem.findByGenre", query = "SELECT m FROM Mem m WHERE m.genre = :genre")})
public class Mem implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "MemberCode")
    private Integer memberCode;
    @Basic(optional = false)
    @Column(name = "Name")
    private String name;
    @Column(name = "PhoneNumber")
    private String phoneNumber;
    @Basic(optional = false)
    @Column(name = "Email")
    private String email;
    @Basic(optional = false)
    @Column(name = "Address")
    private String address;
    @Basic(optional = false)
    @Column(name = "BirthYear")
    private String birthYear;
    @Basic(optional = false)
    @Column(name = "Genre")
    private boolean genre;

    public Mem() {
    }

    public Mem(Integer memberCode) {
        this.memberCode = memberCode;
    }

    public Mem(Integer memberCode, String name, String email, String address, String birthYear, boolean genre) {
        this.memberCode = memberCode;
        this.name = name;
        this.email = email;
        this.address = address;
        this.birthYear = birthYear;
        this.genre = genre;
    }

    public Integer getMemberCode() {
        return memberCode;
    }

    public void setMemberCode(Integer memberCode) {
        this.memberCode = memberCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getBirthYear() {
        return birthYear;
    }

    public void setBirthYear(String birthYear) {
        this.birthYear = birthYear;
    }

    public boolean getGenre() {
        return genre;
    }

    public void setGenre(boolean genre) {
        this.genre = genre;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (memberCode != null ? memberCode.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Mem)) {
            return false;
        }
        Mem other = (Mem) object;
        if ((this.memberCode == null && other.memberCode != null) || (this.memberCode != null && !this.memberCode.equals(other.memberCode))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "persistentClass.Mem[memberCode=" + memberCode + "]";
    }

}
